/**
* Author: fulishang
* Create Time  : 2016年4月24日,下午10:27:20
* Modify Time :
* Desc  : 
*/
package com.sam.hr.domain;

import java.io.Serializable;
import java.util.HashSet;
import java.util.Set;

import javax.persistence.Column;
import javax.persistence.DiscriminatorValue;
import javax.persistence.Entity;
import javax.persistence.OneToMany;

import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;

@Entity
@Cache(usage=CacheConcurrencyStrategy.READ_WRITE)
@DiscriminatorValue(value="2")
public class Manager extends Employee implements Serializable{

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	//该经理管理的部门
	@Column(name="dept_name", length=50)
	private String dept;
	
	//该经理对应的所有员工
	@OneToMany(targetEntity=Employee.class, mappedBy="manager")
	private Set<Employee> employees = new HashSet<Employee>();
	
	//该经理签署的所有批复
	@OneToMany(targetEntity=CheckBack.class, mappedBy="manager")
	private Set<CheckBack> checks = new HashSet<CheckBack>();
	
	//无参构造
	public Manager(){}
	
	//初始化全部的成员变量的构造器
	public Manager(String dept, Set<Employee> employees, Set<CheckBack> checks) {
		this.dept = dept;
		this.employees = employees;
		this.checks = checks;
	}

	//setters and getters
	public String getDept() {
		return dept;
	}

	public void setDept(String dept) {
		this.dept = dept;
	}

	public Set<Employee> getEmployees() {
		return employees;
	}

	public void setEmployees(Set<Employee> employees) {
		this.employees = employees;
	}

	public Set<CheckBack> getChecks() {
		return checks;
	}

	public void setChecks(Set<CheckBack> checks) {
		this.checks = checks;
	}
	
	

}
